-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make default rooting behavior consistent #3124
Conversation
{ | ||
switch (s.ToLowerInvariant ()) { | ||
case "default": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any chance we get this on the command line?
Just thinking about backward compat.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's definitely possible - someone could have set RootMode=default
on ManagedAssemblyToLink
- but we never documented that and I hope nobody is doing it. My preference is to get rid of it, but if this is a real concern I can keep support for it. It would just be a bit unfortunate that "default" is no longer the default. @marek-safar, thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's OK to break this as well - especially since this is 8.0 only and we will have TFM-specific linker then.
…ly for the linker. Not only is it no longer necessary, it's wrong after dotnet/linker#3124.
…ly for the linker. Not only is it no longer necessary (hasn't been for a while), it'll be wrong in .NET 8 after dotnet/linker#3124.
<TrimmerRootAssembly Include="@(IntermediateAssembly)" /> | ||
<TrimmerRootAssembly Include="@(IntermediateAssembly)" RootMode="EntryPoint" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sbomer Android apps are actually class libraries, there is no static void Main()
because Android's entry point is either an Android.App.Application
or Android.App.Activity
.
I think this change causes:
ILLink error IL1034: Root assembly 'MyAndroidApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have entry point.
Should I do this in the Android workload?
<ItemGroup>
<TrimmerRootAssembly Update="@(TrimmerRootAssembly)" RootMode="Library" />
</ItemGroup>
Context: dotnet/linker#3124 (comment) Android projects are class libraries, and this current triggers: ILLink error IL1034: Root assembly 'MyAndroidApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have entry point.
Changes: dotnet/installer@243326d...167a4ed Changes: dotnet/linker@13b8d6d...27ce032 Changes: dotnet/runtime@dd7fdb7...1a37caf Changes: dotnet/emsdk@b6656f5...96351a7 Updates: * Microsoft.Dotnet.Sdk.Internal: from 8.0.100-alpha.1.22602.5 to 8.0.100-alpha.1.22611.1 * Microsoft.NET.ILLink.Tasks: from 7.0.100-1.22564.1 to 8.0.100-1.22609.1 * Microsoft.NETCore.App.Ref: from 8.0.0-alpha.1.22559.2 to 8.0.0-alpha.1.22605.1 * Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100: from 8.0.0-alpha.1.22554.1 to 8.0.0-alpha.1.22558.2 Other changes: * Update `.apkdesc` files * [illink] avoid `IL1034` for `.exe` files Context: dotnet/linker#3124 (comment) Android projects are class libraries, and this currently triggers: ILLink error IL1034: Root assembly 'MyAndroidApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have entry point. Issue filed at: dotnet/linker#3165 Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
…ly for the linker. (#17026) It's automatically done in the linker's MSBuild logic. Not only is it no longer necessary (hasn't been for a while), it'll be wrong in .NET 8 after dotnet/linker#3124.
Now specifying an assembly as a root without any other qualifiers will default to rooting everything. Commit migrated from dotnet@e775974
Now specifying an assembly as a root without any other qualifiers will default to rooting everything. Commit migrated from dotnet/linker@e775974
Now specifying an assembly as a root without any other qualifiers will default to rooting everything. Fixes #1541